﻿using System;

namespace Basics102_DisplayOutput
{
    /// <summary>
    /// Author: Mr. Jin Vincent N. Necesario
    /// Level: Beginner
    /// Problem: Write a program that computes the product of the first then positive integers 
    /// e.g. 1x2x3x4...x10, and the sum of the reciprocals 1/1 + 1/2 + 1/3 ... 1/10. 
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            float[] tenNumbers = new float[10] { 1.0f ,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f,8.0f,9.0f,10.0f};

            int product = 1;

            float sumofreciprocal = 0.0f;

            foreach (int num in tenNumbers)
            {
                product *= num;
            }

            foreach (float num in  tenNumbers)
            {
                sumofreciprocal += 1 / num;
            }

            Console.WriteLine("Product of 1 through 10 is: => {0}", product);
            
            Console.WriteLine("Sum of Reciprocal 1 through 10 is: => {0} ", sumofreciprocal);

            Console.ReadKey();
         }
    }
}
